var tcpp = require('tcp-ping');

var option = {
    address: "www.baidu.com",
    port: 80,
    timeout: 3000,
    attempts: 1
};

tcpp.ping(option, function (err, data) {
    if (!err) {
        console.log(data);
    } else {
        console.log('case error:' + err)
    }
});